package org.zebra.web.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 跨域自动配置属性
 *
 * @author zhanghongbin
 */
@Data
@ConfigurationProperties("zebra.web")
public class ZebraProperties {

    private Sign sign;

    private GlobalAdvice globalAdvice;

    private Crypto crypto;

    private Xss xss;

    public ZebraProperties() {
        this.sign = new Sign();
        this.xss = new Xss();
        this.globalAdvice = new GlobalAdvice();
    }

    @Data
    public static class Xss {
        private String[] excludes = new String[0];
    }

    @Data
    public static class GlobalAdvice {
        private String[] excludes = new String[0];
    }

    @Data
    public static class Crypto {
        private String algorithm;
        private String secretKey;
        private String publicKey;
        private String privateKey;
    }

    @Data
    public static class Sign {
        private String secretKey = "zebra-apisign-1234567890";
    }
}
